package com.muse.designpatterns.strategy;

import com.muse.designpatterns.strategy.duck.Duck;
import com.muse.designpatterns.strategy.duck.RubberDuck;
import com.muse.designpatterns.strategy.fly.FlyWithWings;

/**
 * 策略模式
 */
public class StrategyTest {
    public static void main(String[] args) {
        Duck rubberDuck = new RubberDuck();
        rubberDuck.display();
        rubberDuck.fly();

        System.out.println("改造 让橡皮鸭能飞起来");
        rubberDuck.setFlyBehavior(new FlyWithWings());
        rubberDuck.fly();
    }
}
